﻿<%@ Page Title="" Language="C#" MasterPageFile="~/PortalParts/Portal.Master" AutoEventWireup="true" CodeBehind="JoinPartyNotice.aspx.cs" Inherits="ZHDJ.Web.Portal.JoinPartyNotice" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript">
        function cbcheck() {
            if ($("input[type='checkbox']").is(":checked")) {
                var currentUser = "<%= this.CurrentUser.LoginID%>";
                $.ajax({
                    url: "JoinPartyNotice.aspx/GetRunState",
                    type: "post",
                    dataType: "json",
                    contentType: "application/json",
                    data: "{currentUser:\"" + currentUser + "\"}",
                    success: function (data) {
                        if (data.d == "-1") {

                            //检查申请
                            $.ajax({
                                url: "JoinPartyNotice.aspx/GetJoinPartyRegisters",
                                type: "post",
                                dataType: "json",
                                contentType: "application/json",
                                data: "{currentUser:\"" + currentUser + "\"}",
                                success: function (data1) {
                                    if (data1.d == 0) {
                                        $("#divJoinPartyNotice").hide();
                                        $("#divRegistered").show();
                                    } else {
                                        alert("已经登记，请勿重复登记。");
                                    }
                                }
                            });


                        }
                        else {
                            alert("当前用户为非注册用户，不能登记个人信息！");
                        }
                    }
                });
            }
            else {
                alert("请勾选我已阅读入党须知。");
            }
            return false;
        }

        function submit() {
            if ($("#ctl00_ContentPlaceHolder1_txtUserName").val() && $("#ctl00_ContentPlaceHolder1_txtTelephoneNumber").val() && $("#ctl00_ContentPlaceHolder1_txtDescription").val()) {
                //alert("信息已经登记，请耐心等候联系！");
                alreadySubmit = 1;
                $("#ctl00_ContentPlaceHolder1_btnSubmitEx").click();
            }
            else {
                alert("姓名、联系方式及简单介绍均不能为空！");
                //return;
            }
        }

        function validateData() {
            var userName = $("#ctl00_ContentPlaceHolder1_Form1_sdfsdf_ppUser-inputEl").val();
            var idCard = $("#ctl00_ContentPlaceHolder1_Form1_sdfsdf_txtIDCard-inputEl").val();
            var birthday = $("#ctl00_ContentPlaceHolder1_Form1_sdfsdf_dpBirthday-inputEl").val();
            var mobileNo = $("#ctl00_ContentPlaceHolder1_Form1_sdfsdf_txtMobileNo-inputEl").val();
            var address = $("#ctl00_ContentPlaceHolder1_Form1_sdfsdf_txtAddress-inputEl").val();
            var workUnit = $("#ctl00_ContentPlaceHolder1_Form1_sdfsdf_txtWorkUnit-inputEl").val();
            var workAdress = $("#ctl00_ContentPlaceHolder1_Form1_sdfsdf_txtWorkAddress-inputEl").val();
            var applyTime = $("#ctl00_ContentPlaceHolder1_Form1_sdfsdf_dpApplyTime-inputEl").val();

            if (userName == "") {
                alert("姓名不能为空");
                return false;
            }
            else if (idCard == "") {
                alert("身份证号码不能为空");
                return false;
            }
            else if (birthday == "") {
                alert("生日日期不能为空");
                return false;
            }
            else if (mobileNo == "") {
                alert("手机号码不能为空");
                return false;
            }
            else if (address == "") {
                alert("居住地址不能为空");
                return false;
            }
            else if (workUnit == "") {
                alert("学习/工作单位不能为空");
                return false;
            }
            else if (workAdress == "") {
                alert("工作所在地不能为空");
                return false;
            }
            else if (applyTime == "") {
                alert("递交申请书时间不能为空");
                return false;
            }

            return true;
        }

        $(function () {
            $("#ctl00_ContentPlaceHolder1_txtUserName").val("");
            $("#ctl00_ContentPlaceHolder1_txtTelephoneNumber").val("");
            $("#ctl00_ContentPlaceHolder1_txtDescription").val("");
            $("#divRegistered").hide();
            //$("#divJoinPartyNotice").hide();
            $("#btnSubmit").click(function () {
                cbcheck();
            })
            $("#btnSave").click(function () {
                submit();
            });

            $("#ctl00_ContentPlaceHolder1_Form1_sdfsdf_btnSave").click(function () {
                return validateData();
            });
        })
    </script>
    <style type="text/css">
        .cbstyle {
            vertical-align: middle;
            overflow: hidden;
            height: 50px;
        }

        .btnstyle {
            width: 120px;
            height: 28px;
        }

        #tbmessage {
            font-size: 14px;
        }

            #tbmessage tr {
                height: 30px;
            }

        .x-panel-body {
            overflow: inherit;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <f:PageManager ID="PageManager1" runat="server" />
    <f:Form runat="server" ShowBorder="false" ShowHeader="false" ID="Form1" Margin="5 5 5 5">
        <Items>
            <f:ContentPanel runat="server" ID="sdfsdf" ShowBorder="false">
                <div id="divJoinPartyNotice">
                    <div>
                        <div style="width: 80%; margin-left: 120px"><%=GetNotice() %></div>
                    </div>
                    <div runat="server" id="onlineVideo" style="width: 80%; margin-left: 120px">
                        <div id="a1"></div>
                        <script type="text/javascript" src="/Resource/ckplayer/ckplayer.js" charset="utf-8"></script>
                        <script type="text/javascript">
                            var ismp4 = 0;
                            var flashvars = {
                                f: 'http://shtdj.shanhaitian.gov.cn/upload/file/20170414/12312312312312312331231.flv',
                                c: 0
                            };

                            var params = { bgcolor: '#FFF', allowFullScreen: true, allowScriptAccess: 'always', wmode: 'transparent' };
                            if (ismp4 == 1) {
                                var video = ['http://shtdj.shanhaitian.gov.cn/upload/file/20170414/12312312312312312331231.flv'];
                                CKobject.embed('/Resource/ckplayer/ckplayer.swf', 'a1', 'ckplayer_a1', '100%', '100%', true, flashvars, video, params);
                            } else {
                                CKobject.embedSWF('/Resource/ckplayer/ckplayer.swf', 'a1', 'ckplayer_a1', '100%', '562', flashvars, params);
                            }
                        </script>

                    </div>
                    <div style="text-align: center; line-height: 28px;" id="divcheckbox">
                        <input type="checkbox" class="cbstyle" value="1" />我已阅读入党须知， 我愿意加入中国共产党
                    </div>
                    <div style="vertical-align: middle; text-align: center;">
                        <input type="button" id="btnSubmit" value="登记个人信息" class="btnstyle" />
                    </div>
                </div>
                <div id="divRegistered">
                    <div class="cztable">
                        <div style="width: 100%; background: #f2f2f2;">
                            <span style="display: inline-block; font-size: 16px; font-weight: bold; background: #fff; height: 38px; line-height: 38px; color: #171717; padding: 0 20px; border-top: solid 2px #ea0900;">快速登记</span>
                        </div>
                        <table class="table_b mycontactinfo mycustomtable" border="0" cellspacing="0" cellpadding="0" style="margin-top: 20px;">
                            <tr class="tr_b">
                                <th class="th_b">姓名</th>
                                <td class="td_b">
                                    <f:TextBox ID="txtUserName" runat="server" Readonly="true" Width="300px"></f:TextBox>
                                </td>
                                <td colspan="3" rowspan="5" style="padding-left: 60px;">
                                    <f:Image ID="imgPhoto" ImageUrl="~/Content/icon/blank1.png" ImageWidth="230" ImageHeight="220" ShowEmptyLabel="true" runat="server">
                                    </f:Image>
                                    <f:FileUpload runat="server" ID="filePhoto" ShowRedStar="false" ShowEmptyLabel="true"
                                        ButtonText="上传个人头像" ButtonOnly="true" Required="false" ButtonIcon="ImageAdd"
                                        AutoPostBack="true" OnFileSelected="filePhoto_FileSelected">
                                    </f:FileUpload>
                                    <f:HiddenField ID="hdFileID" runat="server"></f:HiddenField>
                                </td>
                                <%--								<td class="td_b" colspan="2" rowspan="4">
                                    <f:FileUpload runat="server" ID="FileUpload1" ShowRedStar="false" ShowEmptyLabel="true"
                                        ButtonText="上传个人头像" ButtonOnly="true" Required="false" ButtonIcon="ImageAdd"
                                        AutoPostBack="true" OnFileSelected="filePhoto_FileSelected" CssStyle="">
                                    </f:FileUpload>
                                    <f:HiddenField ID="HiddenField1" runat="server"></f:HiddenField>
                                </td>--%>
                            </tr>
                            <tr>
                                <th class="th_b">性别</th>
                                <td class="td_b">
                                    <f:RadioButtonList ID="rblGender" runat="server" AutoPostBack="true">
                                        <f:RadioItem Selected="true" Text="男" Value="0" />
                                        <f:RadioItem Text="女" Value="1" />
                                    </f:RadioButtonList>
                                </td>
                            </tr>
                            <tr>
                                <th class="th_b">身份证号码</th>
                                <td class="td_b">
                                    <f:TextBox ID="txtIDCard" Width="300px" runat="server" Required="true" ShowRedStar="true" MaxLength="18">
                                    </f:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <th class="th_b">出生日期</th>
                                <td class="td_b">
                                    <f:DatePicker ID="dpBirthday" runat="server" Width="300px" DateFormatString="yyyy-MM-dd"></f:DatePicker>
                                </td>
                            </tr>
                            <tr>
                                <th class="th_b">民族</th>
                                <td class="td_b">
                                    <f:TextBox ID="txtNation" Width="300px" runat="server" MaxLength="18">
                                    </f:TextBox>
                                </td>
                                <%--                                <th class="th_b">照片</th>
                                <td class="td_b">
                                    <f:FileUpload runat="server" ID="filePhoto" ShowRedStar="false" ShowEmptyLabel="true"
                                        ButtonText="上传个人头像" ButtonOnly="true" Required="false" ButtonIcon="ImageAdd"
                                        AutoPostBack="true" OnFileSelected="filePhoto_FileSelected" CssStyle="">
                                    </f:FileUpload>
                                    <f:HiddenField ID="hdFileID" runat="server"></f:HiddenField>
                                </td>--%>
                            </tr>
                            <tr>
                                <th class="th_b">籍贯</th>
                                <td class="td_b">
                                    <f:TextBox ID="txtNativePlace" runat="server" Width="300px"></f:TextBox>
                                </td>
                                <td class="td_b" style="width: 60px;"></td>
                                <th class="th_b">文化程度</th>
                                <td class="td_b">
                                    <%-- <f:TextBox ID="txtEducational" runat="server" Width="300px"></f:TextBox>--%>
                                    <f:DropDownList LabelWidth="294px" LabelAlign="right" runat="server" ID="ddlEducation" FocusOnPageLoad="true">
                                        <f:ListItem Text="大专以下" Value="大专以下" />
                                        <f:ListItem Text="大专" Value="大专" />
                                        <f:ListItem Text="本科" Value="本科" Selected="true" />
                                        <f:ListItem Text="硕士" Value="硕士" />
                                        <f:ListItem Text="博士" Value="博士" />
                                    </f:DropDownList>
                                </td>
                            </tr>
                            <tr class="tr_b">
                                <th class="th_b">联系电话</th>
                                <td class="td_b">
                                    <f:TextBox ID="txtMobileNo" runat="server" Required="true" ShowRedStar="true" Width="300px"></f:TextBox>
                                </td>
                                <td class="td_b"></td>
                                <th class="th_b">邮箱</th>
                                <td class="td_b">
                                    <f:TextBox ID="txtEmail" runat="server" Width="300px"></f:TextBox>
                                </td>
                            </tr>
                            <tr class="tr_b">
                                <th class="th_b">QQ号码</th>
                                <td class="td_b">
                                    <f:TextBox ID="txtQQNumber" Width="300px" runat="server" MaxLength="18">
                                    </f:TextBox>
                                </td>
                                <td class="td_b"></td>
                                <th class="th_b">微信号</th>
                                <td class="td_b">
                                    <f:TextBox ID="txtWeiXinNo" Width="300px" runat="server" MaxLength="18">
                                    </f:TextBox>
                                </td>
                            </tr>
                            <tr class="tr_b">
                                <th class="th_b">居住地址</th>
                                <td class="td_b">
                                    <f:TextBox ID="txtAddress" runat="server" Width="300px" Required="true" ShowRedStar="true"></f:TextBox>
                                </td>
                                <td class="td_b"></td>
                                <th class="th_b">学习/工作单位</th>
                                <td class="td_b">
                                    <f:TextBox ID="txtWorkUnit" runat="server" Width="300px" Required="true" ShowRedStar="true"></f:TextBox>
                                </td>
                            </tr>
                            <tr class="tr_b">
                                <th class="th_b">工作所在地</th>
                                <td class="td_b">
                                    <f:TextBox ID="txtWorkAddress" runat="server" Width="300px" Required="true" ShowRedStar="true"></f:TextBox>
                                </td>
                                <td class="td_b"></td>
                                <th class="th_b">递交申请书时间</th>
                                <td class="td_b">
                                    <f:DatePicker ID="dpApplyTime" runat="server" Required="true"
                                        DateFormatString="yyyy-MM-dd" EmptyText="请选择递交申请书时间" ShowRedStar="true" Width="300px">
                                    </f:DatePicker>
                                </td>
                            </tr>
                            <tr class="tr_b">
                                <th class="th_b">接受申请的党支部</th>
                                <td class="td_b">
                                    <f:TwinTriggerBox runat="server" ID="ppBranch" ShowTrigger1="true" Width="300px" ShowTrigger2="true" Trigger1Icon="Clear" EnableEdit="false">
                                    </f:TwinTriggerBox>
                                </td>
                                <td class="td_b"></td>
                                <td colspan="2" class="td_b"><span style="color: red;">(可根据你的工作所在地、居住地址找最近的党支部提交你的入党申请)</span></td>
                            </tr>
                        </table>
                        <table class="table_b" style="border: none;">
                            <tr class="tr_b mysubtn">
                                <td class="td_b" colspan="5" style="text-align: center; background: #fff;">
                                    <asp:Button ID="btnSave" runat="server" Text="保存" CssClass="mybtn" OnClick="btnSave_Click" Visible="false" />
                                    <asp:Button ID="btnSubmitInfo" runat="server" Text="提交" CssClass="mybtn" OnClick="btnSubmitInfo_Click" />
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
            </f:ContentPanel>
        </Items>
    </f:Form>
    <f:Window ID="Window1" CloseAction="Hide" runat="server" IsModal="true" Title="选择党支部"
        Hidden="true" Target="Parent" EnableResize="true" EnableMaximize="true" EnableIFrame="true"
        IFrameUrl="about:blank" Width="700px" Height="500px">
    </f:Window>
    <f:HiddenField ID="hdBranchID" runat="server"></f:HiddenField>
</asp:Content>
